/**
 * Created by Dalyn on 2017/3/1.
 */
/*导入模块*/
import React,{Component} from 'react';
import {Link,hashHistory,browserHistory} from "react-router";
import "./css/Tab_title.css";

import { Menu, Icon } from 'antd';
const SubMenu = Menu.SubMenu;
/*默认导出组件*/
export default class Tab extends React.Component {
    constructor(props){
        super(props);
        this.arr=[];
        this.state={
            selected:true,
            current:"",
            openKeys: [],
            authorityIds:[],
        };
        this.serviceType = sessionStorage.getItem('serviceType');
        this.tab_height="900px";
        this.current_item="home";
        this.account_menu_item=[
            /*{
             key: 'account',
             text: '所有页面',
             link: '/account'
             },*/
            {
                key: 'rechargerecordcompany',
                text: '账户充值',
                link: '/rechargerecordcompany',
                authorityId:'2'
            },
            {
                key: 'loanrecord',
                text: '借款记录',
                link: '/loanrecord',
                authorityId:'3'
            },
            {
                key: 'settlementrecord',
                text: '订单结算',
                link: '/settlementrecord',
                authorityId:'4'
            },
            {
                key: 'orderpaymentlist',
                text: '订单付款',
                link: '/orderpaymentlist',
                authorityId:'5'
            },
            /* {
             key: 'ordertradelist',
             text: '交易记录',
             link: '/ordertradelist',
             authorityId:'6'
             },*/
            {
                key: 'taxrefundmanagement',
                text: '退税管理',
                link: '/taxrefundmanagement',
                authorityId:'27'
            }
        ];
        this.product_menu_item=[
            {
                key: 'product',
                text: '我的产品库',
                link: '/product',
                authorityId:'7'
            },
            /*      {
             key: 'productimport',
             text: '产品库',
             link: '/productimport',
             authorityId:'8'
             },*/
        ];
        this.order_menu_item=[
            {
                key: 'ordersaleno',
                text: '未签订单',
                link: '/ordersaleno',
                authorityId:'11'
            },
            {
                key: 'ordersaleyes',
                text: '已签订单',
                link: '/ordersaleyes',
                authorityId:'12'
            },
            {
                key: 'entryordergms',
                text: '录入成衣订单',
                link: '/entryordergms',
                authorityId:'12'
            },
        ];
        this.purchase_menu_item=[
            /* {
             key: 'orderpurch',
             text: '采购订单',
             link: '/orderpurch',
             authorityId:'13'
             },*/
            {
                key: 'orderpurchno',
                text: '未签订单',
                link: '/orderpurchno',
                authorityId:'13'
            },
            {
                key: 'orderpurchyes',
                text: '已签订单',
                link: '/orderpurchyes',
                authorityId:'73'
            },
            {
                key: 'createordergms',
                text: '新建成衣订单',
                link: '/creatorderbystep',
                authorityId:'14'
            },
            {
                key: 'createordercloth',
                text: '新建面料订单',
                link: '/creatorderbystep',
                authorityId:'15',
            },
            {
                key: 'createorderraw',
                text: '新建辅料订单',
                link: '/creatorderbystep',
                authorityId:'16',
            },
            {
                key: 'createorderyarn',
                text: '新建纱线订单',
                link: '/creatorderbystep',
                authorityId:'17',
            },
            {
                key: 'createorderprint',
                text: '新建印染订单',
                link: '/creatorderbystep',
                authorityId:'18',
            },
        ];
        this.production_menu_item=[
            /*{
             key: 'productionschedule',
             text: '生产排期',
             link: '/productionschedule',
             authorityId:'-1'
             },*/
            {
                key: 'productionlicense',
                text: '生产制单',
                link: '/productionlicense',
                authorityId:'24'
            },{
                key: 'fabricrawprocess',
                text: '面辅料进度',
                link: '/fabricrawprocess',
                authorityId:'26'
            },{
                key: 'productionprocess',
                text: '生产进度',
                link: '/productionprocess',
                authorityId:'25'
            },
        ];
        this.arr = [
            {
                text: '首页',
                link: '/home',
                name:"home",
                authorityId:'-1'
            },
            {
                text: '销售管理',
                link: '/order',
                name:"order",
                authorityId:''
            },
            {
                text: '采购管理',
                link: '/purchase',
                name:"purchase",
                authorityId:''
            },
            {
                text: '生产管理',
                link: '/production',
                name:"production",
                authorityId:''
            },
            {
                text: '企业账户',
                link: '/account',
                name:"account",
                authorityId:''
            },
            {
                text: '人员管理',
                link: '/people',
                name:"people",
                authorityId:'9'
            },
            {
                text: '产品管理',
                link: '/product',
                name:"product",
                authorityId:'7'
            },
            {
                text: '权限设置',
                link: '/limit',
                name:"limit",
                authorityId:'10'
            },
            {
                text: '企业设置',
                link: '/company',
                name:"company",
                authorityId:'1'
            },

            // {
            //     text: '审批管理',
            //     link: '/productimport'
            // }
        ];
        /*二级菜单对应的一级菜单*/
        this.subParentMenu={
            "rechargerecordcompany":"/account",
            "loanrecord":"/account",
            "ordertradelist":"/account",
            "settlementrecord":"/account",
            "orderpaymentlist":"/account",
            "payment":"/account",
            "settlementprocess":"/account",
            "ordertradeinfo":"/account",
            "rechargeOrder":"/account",
            "taxrefundmanagement":"/account",

            "orderpurch":"/purchase",
            "orderpurchno":"/purchase",
            "orderpurchyes":"/purchase",

            "creatorderbystep":"/purchase",

            "createordergms":"/purchase",
            "createordercloth":"/purchase",
            "createorderraw":"/purchase",
            "createorderyarn":"/purchase",
            "createorderprint":"/purchase",

            "ordersaleyes":"/order",
            "ordersaleno":"/order",
            "entryordergms":"/order",

            "product":"/product",
            "limit":"/limit",
            "company":"/company",
            "people":"/people",
            "home":"/home",
            /*"productimport":"/product",*/

            "productionlicense":"/production",
            "productionlicenseindex":"/production",
            "fabricrawprocess":"/production",
            "fabricrawlook":"/production",
            "fabricrawedit":"/production",
            "productionprocess":"/production",
            "productionschedule":"/production",
            "ProductionProcessDetail":"/production",
        }

        /*不知道什么用？*/
        this.tabStyle={
            home:true,
            order:false,
            purchase:false,
            account:false,
            people:false,
        };
    }

    componentWillMount() {
        // let location = browserHistory.getCurrentLocation();
        let location = hashHistory.getCurrentLocation();
        // console.log(location);
        let current_item="";
        let currentKey= "sub_";
        //先查询一下是否是二级菜单
        let reg = /\/(\w+)\??/i;
        // let actionArr = null==reg.exec(location.hash)?"":reg.exec(location.hash)[1];
        let actionArr = null==reg.exec(location.pathname)?"":reg.exec(location.pathname)[1];
        let action = actionArr;
        if("" != action){
            let temp = this.subParentMenu[action];
            //先去根据拿到数据去找一级，如果没有拿到，说明拿到的本身是一级
            if(!temp){//action是一级
                this.arr.map((item,index)=>{
                    if(action==item.name){
                        current_item = item.name;
                    }
                });
                //说明选中的是一级
                console.log(current_item);
                console.log(action);
                this.current_item = current_item;
                this.setState({current:action,openKeys: []});
            }else{//拿到了temp，说明action是二级，temp是一级
                this.arr.map((item,index)=>{
                    if(temp=="/"+item.name){
                        current_item = item.name;
                        currentKey = currentKey+item.name;
                    }
                });
                /*企业账户二级菜单内嵌页面*/
                if(action == "settlementprocess"){
                    action = "settlementrecord"
                }else if(action == "payment"){
                    action = "orderpaymentlist"
                }
                /*创建订单步骤页面*/
                if(action == "creatorderbystep"){
                    let state = location.state;
                    action = state.name
                }
                /*生产制单二级菜单内嵌页面*/
                if(action == "productionlicenseindex"){
                    action = "productionlicense"
                }else if(action == "fabricrawlook"){
                    action = "fabricrawprocess"
                }else if(action == "fabricrawedit"){
                    action = "fabricrawprocess"
                }else if(action == "ProductionProcessDetail"){
                    action = "productionprocess"
                }
                this.current_item = current_item;
                this.setState({ openKeys: [currentKey],current:action});
            }
        }
        let pIds = sessionStorage.getItem('permissionId');
        if (pIds != null && pIds !='' && pIds !=undefined ){
            let authIds = pIds.split(",");
            this.setState({
                authorityIds:authIds
            });
        }
    }

    leftTreeMenuClick(i){
        this.current_item = i;
        this.setState({ current_item: i});
    }
    leftLevelMenu(i) {
        /*获取当前dom内容高度*/
        // this.tab_height = document.body.scrollHeight+"px";
        this.current_item = i;
    }
    leftTreeClick(i) {
        // this.tab_height = document.body.scrollHeight+"px";
        this.current_item = i;
        this.setState({
            openKeys: [],
            current:"",
        });
    }
    /*Menu组件方法*/
    handleClick = (e) => {
        this.setState({
            current: e.key,
        });
    };
    onOpenChange = (openKeys) => {
        const state = this.state;
        const latestOpenKey = openKeys.find(key => !(state.openKeys.indexOf(key) > -1));
        const latestCloseKey = state.openKeys.find(key => !(openKeys.indexOf(key) > -1));

        let nextOpenKeys = [];
        if (latestOpenKey) {
            nextOpenKeys = this.getAncestorKeys(latestOpenKey).concat(latestOpenKey);
        }
        if (latestCloseKey) {
            nextOpenKeys = this.getAncestorKeys(latestCloseKey);
        }
        this.setState({
            openKeys: nextOpenKeys,
        });
    };
    getAncestorKeys = (key) => {
        const map = {
            sub3: ['sub2'],
        };
        return map[key] || [];
    };
    /*企业账户子菜单*/
    menuItem_account(){
        return this.account_menu_item.map((item,index)=>{
            if (!this.authorityIdContain(item.authorityId)) return;
            if(item.key == this.state.current){
                return (
                    <Menu.Item key={item.key} style={{background:"#15283a"}}>
                        <Link to={item.link}  className='tab_link_a_act' style={{color:"#09af9e"}}>{item.text}</Link>
                    </Menu.Item>
                )
            }else {
                if(item.key == "taxrefundmanagement"){
                    if(this.serviceType == "6"){
                        return (
                            <Menu.Item key={item.key} style={{background:"#15283a"}}>
                                <Link to={item.link} className='tab_link_a' style={{color:"#fff"}}>{item.text}</Link>
                            </Menu.Item>
                        )
                    }else{
                        return null;
                    }
                }
                if(item.key == "settlementrecord") {
                    if(this.serviceType == "6"){
                        return  null
                    }
                }
                if(item.key == "orderpaymentlist" || item.key == "loanrecord"){
                    if(this.serviceType == "2" || this.serviceType == "4" || this.serviceType == "5"){
                        return  null
                    }
                }

                return (
                    <Menu.Item key={item.key} style={{background:"#15283a"}}>
                        <Link to={item.link} className='tab_link_a' style={{color:"#fff"}}>{item.text}</Link>
                    </Menu.Item>
                )

            }
        })
    }
    /*产品管理子菜单*/
    menuItem_product(){
        return this.product_menu_item.map((item,index)=>{
            if (!this.authorityIdContain(item.authorityId)) return;
            if(item.key == this.state.current){
                return (
                    <Menu.Item key={item.key} style={{background:"#15283a"}}>
                        <Link to={item.link}  className='tab_link_a_act' style={{color:"#09af9e"}}>{item.text}</Link>
                    </Menu.Item>
                )
            }else {
                return (
                    <Menu.Item key={item.key} style={{background:"#15283a"}}>
                        <Link to={item.link} className='tab_link_a' style={{color:"#fff"}}>{item.text}</Link>
                    </Menu.Item>
                )
            }
        })
    }
    /*订单管理子菜单*/
    menuItem_order(){
        return this.order_menu_item.map((item,index)=>{
            if (!this.authorityIdContain(item.authorityId)) return;
            if(item.key == this.state.current){
                return (
                    <Menu.Item key={item.key} style={{background:"#15283a"}}>
                        <Link to={item.link}  className='tab_link_a_act' style={{color:"#09af9e"}}>{item.text}</Link>
                    </Menu.Item>
                )
            }else {
                if(item.key == "entryordergms"){
                    /*制衣厂录入成衣订单*/
                    if(this.serviceType == 1){
                        return (
                            <Menu.Item key={item.key} style={{background:"#15283a"}}>
                                <Link to={{ pathname: item.link, state: { name: item.key,fromEdit:"entry" } }} className='tab_link_a' style={{color:"#fff"}}>{item.text}</Link>
                            </Menu.Item>
                        )
                    }
                }else {
                    return (
                        <Menu.Item key={item.key} style={{background:"#15283a"}}>
                            <Link to={item.link} className='tab_link_a' style={{color:"#fff"}}>{item.text}</Link>
                        </Menu.Item>
                    )
                }
            }
        })
    }
    /*采购管理子菜单*/
    menuItem_purchase(){
        return this.purchase_menu_item.map((item,index)=>{
            if (!this.authorityIdContain(item.authorityId)) return;
            if(item.key == this.state.current){
                return (
                    <Menu.Item key={item.key} style={{background:"#15283a"}}>
                        <Link to={{ pathname: item.link, state: { name: item.key,fromEdit:"no"}}} className='tab_link_a_act' style={{color:"#09af9e"}}>{item.text}</Link>
                    </Menu.Item>
                )
            }else {
                if(this.serviceType == "6" && (item.key == "orderpurchyes"||item.key == "orderpurchno"||item.key == "orderpurch" || item.key == "createordergms"|| item.key == "createordercloth"|| item.key == "createorderraw")){
                    return (
                        <Menu.Item key={item.key} style={{background:"#15283a"}}>
                            <Link to={{ pathname: item.link, state: { name: item.key,fromEdit:"no" } }} className='tab_link_a' style={{color:"#fff"}}>{item.text}</Link>
                        </Menu.Item>
                    )
                }else if(this.serviceType == "1" && (item.key == "orderpurchyes"||item.key == "orderpurchno"||item.key == "orderpurch" || item.key=="createordergms"|| item.key=="createordercloth"||item.key=="createorderraw")){
                    return (
                        <Menu.Item key={item.key} style={{background:"#15283a"}}>
                            <Link to={{ pathname: item.link, state: { name: item.key,fromEdit:"no"}}} className='tab_link_a' style={{color:"#fff"}}>{item.text}</Link>
                        </Menu.Item>
                    )
                }else if(this.serviceType == "3" && (item.key == "orderpurchyes"||item.key == "orderpurchno"||item.key == "orderpurch" || item.key=="createorderyarn"||item.key=="createorderprint")){
                    return (
                        <Menu.Item key={item.key} style={{background:"#15283a"}}>
                            <Link to={{ pathname: item.link, state: { name: item.key,fromEdit:"no"}}} className='tab_link_a' style={{color:"#fff"}}>{item.text}</Link>
                        </Menu.Item>
                    )
                }else if(this.serviceType == "4" && (item.key == "orderpurch")){
                    return (
                        <Menu.Item key={item.key} style={{background:"#15283a"}}>
                            <Link to={item.link} className='tab_link_a' style={{color:"#fff"}}>{item.text}</Link>
                        </Menu.Item>
                    )
                }
                else if(this.serviceType == "5" && (item.key == "orderpurchyes"||item.key == "orderpurchno"||item.key == "orderpurch")){
                    return (
                        <Menu.Item key={item.key} style={{background:"#15283a"}}>
                            <Link to={item.link} className='tab_link_a' style={{color:"#fff"}}>{item.text}</Link>
                        </Menu.Item>
                    )
                }else if(this.serviceType == "2" && (item.key == "orderpurchyes"||item.key == "orderpurchno"||item.key == "orderpurch")){
                    return (
                        <Menu.Item key={item.key} style={{background:"#15283a"}}>
                            <Link to={item.link} className='tab_link_a' style={{color:"#fff"}}>{item.text}</Link>
                        </Menu.Item>
                    )
                }
            }
        })
    }
    /*生产管理子菜单*/
    menuItem_production(){
        return this.production_menu_item.map((item,index)=>{
            if (!this.authorityIdContain(item.authorityId)) return;
            if(item.key == this.state.current){
                return (
                    <Menu.Item key={item.key} style={{background:"#15283a"}}>
                        <Link to={item.link}  className='tab_link_a_act' style={{color:"#09af9e"}}>{item.text}</Link>
                    </Menu.Item>
                )
            }else {
                return (
                    <Menu.Item key={item.key} style={{background:"#15283a"}}>
                        <Link to={item.link} className='tab_link_a' style={{color:"#fff"}}>{item.text}</Link>
                    </Menu.Item>
                )
            }
        })
    }

    /**
     * 判断此一级菜单是否需要显示
     * @param v
     * @returns {boolean}
     */
    isShowFirstMenu(v){
        let name = v.name;
        let authorityId = v.authorityId;
        if(name =="order"){
            if(this.serviceType =="6"){
                return false;
            }
        }
        if(name=="purchase"){
            if(this.serviceType =="2" || this.serviceType == "5"){
                return false;
            }
        }
        //判断是否有配置权限id
        if (authorityId == ''){
            let link = v.link;
            //获取一级下的二级菜单
            let secondMenu = this.getSecondMenu(link);
            //没有二级那么返回false，不展示此一级菜单
            if (secondMenu == null || secondMenu.length == 0)
                return false;
            //如果有二级菜单,查看二级菜单是否有需要展示的菜单
            return this.checkSecondMenu(secondMenu);
        }else {
            return this.authorityIdContain(authorityId);
        }
    }
    /**
     *检测是否有需要显示的二级菜单
     * @param secondMenu
     * @returns {boolean}
     */
    checkSecondMenu(secondMenu){
        let secondMenuArry = [this.account_menu_item,this.product_menu_item,this.production_menu_item,this.order_menu_item,this.purchase_menu_item];
        for (var i = 0 ; i<secondMenuArry.length ; i++){
            let soureceSecondMenu = secondMenuArry[i];
            let  length= soureceSecondMenu.length;
            let  length02 = secondMenu.length;
            for ( var j = 0 ; j < length ; j++){
                let subLink = soureceSecondMenu[j].link;
                for ( var k=0 ; k <length02 ; k++){
                    if ('/'+secondMenu[k] == subLink){
                        let subAuthorityId = soureceSecondMenu[j].authorityId;
                        if (subAuthorityId != ""){
                            if (this.authorityIdContain(subAuthorityId))
                                return true;
                        }
                    }
                }
            }
        }
        return false;
    }
    /**
     * 获取指定一级下的二级菜单
     * @param link
     * @returns {Array}
     */
    getSecondMenu(link){
        let secondMenu=[];
        for (var p in  this.subParentMenu){
            let value = this.subParentMenu[p];
            if (value == link){
                secondMenu.push(p);
            }
        }
        return secondMenu;
    }

    /**
     * 判断此权限id是否存在此用户的权限中
     * @param authorityId
     * @returns {boolean}
     */
    authorityIdContain(authorityId){
        if (authorityId == '' || authorityId == null)
            return false;
        if (authorityId == '-1') return true;

        let length = this.state.authorityIds == null ? 0 :this.state.authorityIds.length;
        for (var j = 0 ;j< length; j++){
            if (this.state.authorityIds[j] == authorityId){
                return true;
            }
        }
        return false;
    }

    /*没有二级菜单的路由跳转*/
    onTitleClick_tab(type){
        switch (type){
            case "home":
                hashHistory.push("/home");
                break;
            case "people":
                hashHistory.push("/people");
                break;
            case "limit":
                hashHistory.push("/limit");
                break;
            case "company":
                hashHistory.push("/company");
                break;
            case "product":
                hashHistory.push("/product");
                break;
        }
    }
    render() {
        return (
            <div style={{height:this.tab_height}}  className="tab_box">
                <h1 style={Style.logoBox} title="衣有道（北京）科技有限公司">
                    <img style={Style.logo} src="./img/main_logo.png" alt="衣有道"/>
                </h1>
                <div>
                    <Menu
                        mode="inline"
                        openKeys={this.state.openKeys}
                        selectedKeys={[this.state.current]}
                        inlineIndent="24"
                        style={{width: 165, color: "#fff", margin: "4px 0", background: "#1c3249"}}
                        onOpenChange={this.onOpenChange}
                        onClick={this.handleClick}
                        className="main_menu"
                    >
                        {
                            this.arr.map((v, i) => {
                                if (!this.isShowFirstMenu(v)) return;
                                if (v.name == "home") {
                                    return (
                                        <SubMenu key="sub_home"
                                                 className = "main_tab_menu_noItem"
                                                 onTitleClick={this.onTitleClick_tab.bind(this,"home")}
                                                 ref={"home"}
                                                 title={
                                                     <span>
                                                         <Icon type="home"  className="main_tab_menu_icon"/>
                                                             <span className="main_tab_menu_text">{v.text}</span>
                                                     </span>
                                                 }>
                                        </SubMenu>
                                    )
                                }else if(v.name == "order"){
                                    if(this.serviceType != "6"){
                                        return (
                                            <SubMenu key="sub_order"
                                                     title={
                                                         <span>
                                                             <Icon type="database"  className="main_tab_menu_icon"/>
                                                             <span className="main_tab_menu_text">{v.text}</span>
                                                         </span>
                                                     }>
                                                {this.menuItem_order()}
                                            </SubMenu>
                                        )
                                    }
                                }else if(v.name == "purchase"){
                                    if(this.serviceType === "1" || this.serviceType === "3" || this.serviceType === "6"){
                                        return (
                                            <SubMenu key="sub_purchase"
                                                     title={
                                                         <span>
                                                             <Icon type="file-ppt"  className="main_tab_menu_icon"/>
                                                             <span className="main_tab_menu_text">{v.text}</span>
                                                         </span>
                                                     }>
                                                {this.menuItem_purchase()}
                                            </SubMenu>
                                        )
                                    }
                                }else if(v.name == "production"){
                                    if(this.serviceType == "1"){
                                        return (
                                            <SubMenu key="sub_production"
                                                     title={
                                                         <span>
                                                              <Icon type="switcher"  className="main_tab_menu_icon"/>
                                                              <span className="main_tab_menu_text">{v.text}</span>
                                                         </span>
                                                     }>
                                                {this.menuItem_production()}
                                            </SubMenu>
                                        )
                                    }
                                }else if(v.name == "account"){
                                    return (
                                        <SubMenu key="sub_account"
                                                 title={
                                                     <span>
                                                         <Icon type="solution"  className="main_tab_menu_icon"/>
                                                         <span className="main_tab_menu_text">{v.text}</span>
                                                     </span>
                                                 }>
                                            {this.menuItem_account()}
                                        </SubMenu>
                                    )
                                }else if(v.name == "people"){
                                    return(
                                        <SubMenu key={"sub_" + v.name}
                                                 className = "main_tab_menu_noItem"
                                                 onTitleClick={this.onTitleClick_tab.bind(this,"people")}
                                                 title={
                                                     <span className="">
                                                          <Icon type="usergroup-add"  className="main_tab_menu_icon"/>
                                                          <span className="main_tab_menu_text">{v.text}</span>
                                                     </span>
                                                 }>
                                        </SubMenu>
                                    )
                                }else if(v.name == "product"){
                                    return (
                                        <SubMenu key="sub_product"
                                                 className = "main_tab_menu_noItem"
                                                 onTitleClick={this.onTitleClick_tab.bind(this,"product")}
                                                 title={
                                                     <span>
                                                          <Icon type="tags-o"  className="main_tab_menu_icon"/>
                                                          <span className="main_tab_menu_text">{v.text}</span>
                                                     </span>
                                                 }>
                                            {/*{this.menuItem_product()}*/}
                                        </SubMenu>
                                    )
                                }else if(v.name == "limit"){
                                    return(
                                        <SubMenu key={"sub_" + v.name}
                                                 className = "main_tab_menu_noItem"
                                                 onTitleClick={this.onTitleClick_tab.bind(this,"limit")}
                                                 title={
                                                     <span>
                                                          <Icon type="paper-clip"  className="main_tab_menu_icon"/>
                                                          <span className="main_tab_menu_text">{v.text}</span>
                                                     </span>
                                                 }>
                                        </SubMenu>
                                    )
                                } else if (v.name == "company") {
                                    return (
                                        <SubMenu key={"sub_" + v.name}
                                                 className = "main_tab_menu_noItem"
                                                 onTitleClick={this.onTitleClick_tab.bind(this,"company")}
                                                 title={
                                                     <span>
                                                          <Icon type="setting"  className="main_tab_menu_icon"/>
                                                          <span className="main_tab_menu_text">{v.text}</span>
                                                     </span>
                                                 }>
                                            {/*<div onClick={this.leftTreeClick.bind(this, v.name)} className='tab_leftTree_li_active tab_box_company'>
                                             <Link to={v.link}><p><i></i><span>{v.text}</span></p></Link>
                                             </div>*/}
                                        </SubMenu>
                                    )
                                } else {
                                    return (
                                        <SubMenu key={"sub_" + v.name}
                                                 title={
                                                     <span>
                                                         <i className="main_tab_menu_icon"></i>
                                                         <span className="main_tab_menu_text">{v.text}</span>
                                                     </span>
                                                 }>
                                        </SubMenu>
                                    )
                                }
                            })
                        }
                    </Menu>
                </div>
            </div>
        )
    }
}
let Style={
    left:{
        // width: '166px',
        // minHeight:"900px",
        // background:"#1c3249",
        // position:"absolute",
        // top:"0",
        // left:"0"
    },
    logoBox:{
        width:"117px",
        height:"34px",
        margin:"0 auto 14px",
        padding:"15px 0 0",
    },
    logo:{
        width:"100%",
        height:"100%"
    },
    item:{
        width: '100%',
        height: '36px',
        textAlign: 'center',
        lineHeight: '36px',
        marginTop:"20px",
        position:"relative"
    },
    span:{
        fontSize:"16px",
        color:"#fff",
        paddingLeft:"18px"
    },
    item1:{
        width: '100%',
        height: '40px',
        textAlign: 'left',
        lineHeight: '40px',
        margin:"20px 0",
        paddingLeft:"32px",
        position:"relative"
    },
    i_img:{
        display:"inline-block",
        width:"20px",
        height:"20px",
        background:"url('./img/main_sp.png') no-repeat -20px -20px",
        verticalAlign:"-5px"
    }

};
